﻿@model SellAndBuy.Web.ViewModels.AdListViewModel

@{
    ViewBag.Title = "Index";
}

<h2>Ads</h2>

<div id="grid" class="grid" style="height:150px">

@foreach (var item in Model.PageItems) 
{
    <div class="Ad" style="float:left;width:180px;height:130px">
        <div class="frame">
        @if (@item.MainPicture != null)
        { 
            <img alt ='@item.MainPicture.Title' src='@Url.Action("showpic", "home", new { adID = @item.ID, fileName = @item.MainPicture.FileName, maxWidth = 110, maxHeight = 120 })'/>
        }
        </div>
        <div class="price">@item.Price</div>
        <div class="title"><a href="/Home/AdDetails/@item.ID">@item.Description</a></div>
    </div>
}

</div>

@*<p>
    @Html.ActionLink("Create New", "Create")
</p>*@
